function getCheckbox(headJson, table) {
    let checkbox = "";
    $.each(headJson, (field, json) => {

        checkbox += `<div class="form-check"><label class="form-check-label">
                            <input type='checkbox' checked='checked' value="${json.field}"  onclick="setColumns('${json.field}','${table}')"> ${json.title} 
                           <i class="input-helper"></i> </label></div>`
    })
    $(`#${table}-check`).html(checkbox)
}

function setColumns(value,table="table") {
    const element = $(`#${table}-check`).find("input:checkbox[value=" + value + "]");
    if (element.is(":checked")) {
        $('#' + table).bootstrapTable('showColumn', value);
    } else {
        $('#' + table).bootstrapTable('hideColumn', value);
    }
}
